]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
keyboard: simplify using Caribou.KeyModel.label
authorDaiki Ueno <ueno@unixuser.org>
Wed, 31 Oct 2012 01:54:51 +0000 (10:54 +0900)
committerDaiki Ueno <ueno@unixuser.org>
Fri, 2 Nov 2012 23:57:23 +0000 (08:57 +0900)
https://bugzilla.gnome.org/show_bug.cgi?id=687242

js/ui/keyboard.js

index 4d97a9deab35f5264966d9180d3a5f4678cc76ae..482fb30684136a622e7ec9b91b182b3f2fa6e3a9 100644 (file)
@@ -20,25 +20,6 @@ const KEYBOARD_TYPE = 'keyboard-type';
 const A11Y_APPLICATIONS_SCHEMA = 'org.gnome.desktop.a11y.applications';
 const SHOW_KEYBOARD = 'screen-keyboard-enabled';
 
-// Key constants taken from Antler
-// FIXME: ought to be moved into libcaribou
-const PRETTY_KEYS = {
-    'BackSpace': '\u232b',
-    'space': ' ',
-    'Return': '\u23ce',
-    'Caribou_Prefs': '\u2328',
-    'Caribou_ShiftUp': '\u2b06',
-    'Caribou_ShiftDown': '\u2b07',
-    'Caribou_Emoticons': '\u263a',
-    'Caribou_Symbols': '123',
-    'Caribou_Symbols_More': '{#*',
-    'Caribou_Alpha': 'Abc',
-    'Tab': 'Tab',
-    'Escape': 'Esc',
-    'Control_L': 'Ctrl',
-    'Alt_L': 'Alt'
-};
-
 const CaribouKeyboardIface = <interface name='org.gnome.Caribou.Keyboard'>
 <method name='Show'>
     <arg type='u' direction='in' />
@@ -98,17 +79,7 @@ const Key = new Lang.Class({
     },
 
     _makeKey: function () {
-        let label = this._key.name;
-
-        if (label.length > 1) {
-            let pretty = PRETTY_KEYS[label];
-            if (pretty)
-                label = pretty;
-            else
-                label = this._getUnichar(this._key);
-        }
-
-        label = GLib.markup_escape_text(label, -1);
+        let label = GLib.markup_escape_text(this._key.label, -1);
         let button = new St.Button ({ label: label,
                                       style_class: 'keyboard-key' });